Optimal. Leaf size=39 \[ \frac {x}{b}-\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{b \sqrt {a+b}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3171, 3181, 208} \[ \frac {x}{b}-\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{b \sqrt {a+b}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 3171
Rule 3181
Rubi steps
\begin {align*} \int \frac {\cosh ^2(x)}{a+b \cosh ^2(x)} \, dx &=\frac {x}{b}-\frac {a \int \frac {1}{a+b \cosh ^2(x)} \, dx}{b}\\ &=\frac {x}{b}-\frac {a \operatorname {Subst}\left (\int \frac {1}{a-(a+b) x^2} \, dx,x,\coth (x)\right )}{b}\\ &=\frac {x}{b}-\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{b \sqrt {a+b}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.08, size = 36, normalized size = 0.92 \[ \frac {x-\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{\sqrt {a+b}}}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 317, normalized size = 8.13 \[ \left [\frac {\sqrt {\frac {a}{a + b}} \log \left (\frac {b^{2} \cosh \relax (x)^{4} + 4 \, b^{2} \cosh \relax (x) \sinh \relax (x)^{3} + b^{2} \sinh \relax (x)^{4} + 2 \, {\left (2 \, a b + b^{2}\right )} \cosh \relax (x)^{2} + 2 \, {\left (3 \, b^{2} \cosh \relax (x)^{2} + 2 \, a b + b^{2}\right )} \sinh \relax (x)^{2} + 8 \, a^{2} + 8 \, a b + b^{2} + 4 \, {\left (b^{2} \cosh \relax (x)^{3} + {\left (2 \, a b + b^{2}\right )} \cosh \relax (x)\right )} \sinh \relax (x) + 4 \, {\left ({\left (a b + b^{2}\right )} \cosh \relax (x)^{2} + 2 \, {\left (a b + b^{2}\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a b + b^{2}\right )} \sinh \relax (x)^{2} + 2 \, a^{2} + 3 \, a b + b^{2}\right )} \sqrt {\frac {a}{a + b}}}{b \cosh \relax (x)^{4} + 4 \, b \cosh \relax (x) \sinh \relax (x)^{3} + b \sinh \relax (x)^{4} + 2 \, {\left (2 \, a + b\right )} \cosh \relax (x)^{2} + 2 \, {\left (3 \, b \cosh \relax (x)^{2} + 2 \, a + b\right )} \sinh \relax (x)^{2} + 4 \, {\left (b \cosh \relax (x)^{3} + {\left (2 \, a + b\right )} \cosh \relax (x)\right )} \sinh \relax (x) + b}\right ) + 2 \, x}{2 \, b}, -\frac {\sqrt {-\frac {a}{a + b}} \arctan \left (\frac {{\left (b \cosh \relax (x)^{2} + 2 \, b \cosh \relax (x) \sinh \relax (x) + b \sinh \relax (x)^{2} + 2 \, a + b\right )} \sqrt {-\frac {a}{a + b}}}{2 \, a}\right ) - x}{b}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.13, size = 50, normalized size = 1.28 \[ -\frac {a \arctan \left (\frac {b e^{\left (2 \, x\right )} + 2 \, a + b}{2 \, \sqrt {-a^{2} - a b}}\right )}{\sqrt {-a^{2} - a b} b} + \frac {x}{b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.10, size = 110, normalized size = 2.82 \[ -\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{b}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{b}+\frac {\sqrt {a}\, \ln \left (-\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 \sqrt {a}\, \tanh \left (\frac {x}{2}\right )-\sqrt {a +b}\right )}{2 b \sqrt {a +b}}-\frac {\sqrt {a}\, \ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 \sqrt {a}\, \tanh \left (\frac {x}{2}\right )+\sqrt {a +b}\right )}{2 b \sqrt {a +b}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.51, size = 120, normalized size = 3.08 \[ -\frac {{\left (2 \, a + b\right )} \log \left (\frac {b e^{\left (2 \, x\right )} + 2 \, a + b - 2 \, \sqrt {{\left (a + b\right )} a}}{b e^{\left (2 \, x\right )} + 2 \, a + b + 2 \, \sqrt {{\left (a + b\right )} a}}\right )}{4 \, \sqrt {{\left (a + b\right )} a} b} - \frac {\log \left (\frac {b e^{\left (-2 \, x\right )} + 2 \, a + b - 2 \, \sqrt {{\left (a + b\right )} a}}{b e^{\left (-2 \, x\right )} + 2 \, a + b + 2 \, \sqrt {{\left (a + b\right )} a}}\right )}{4 \, \sqrt {{\left (a + b\right )} a}} + \frac {x}{b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.38, size = 376, normalized size = 9.64 \[ \frac {x}{b}+\frac {\sqrt {a}\,\mathrm {atan}\left (\frac {\left (b^5\,\sqrt {-b^3-a\,b^2}+a\,b^4\,\sqrt {-b^3-a\,b^2}\right )\,\left ({\mathrm {e}}^{2\,x}\,\left (\frac {2\,\left (8\,a^{5/2}\,\sqrt {-b^3-a\,b^2}+\sqrt {a}\,b^2\,\sqrt {-b^3-a\,b^2}+8\,a^{3/2}\,b\,\sqrt {-b^3-a\,b^2}\right )\,\left (8\,a^2+8\,a\,b+b^2\right )}{b^8\,{\left (a+b\right )}^2\,\sqrt {-b^3-a\,b^2}}+\frac {4\,\sqrt {a}\,\left (4\,a+2\,b\right )\,\left (8\,a^3\,b+12\,a^2\,b^2+4\,a\,b^3\right )}{b^7\,\left (a+b\right )\,\sqrt {-b^2\,\left (a+b\right )}\,\sqrt {-b^3-a\,b^2}}\right )+\frac {2\,\left (\sqrt {a}\,b^2\,\sqrt {-b^3-a\,b^2}+2\,a^{3/2}\,b\,\sqrt {-b^3-a\,b^2}\right )\,\left (8\,a^2+8\,a\,b+b^2\right )}{b^8\,{\left (a+b\right )}^2\,\sqrt {-b^3-a\,b^2}}+\frac {4\,\sqrt {a}\,\left (2\,a^2\,b^2+2\,a\,b^3\right )\,\left (4\,a+2\,b\right )}{b^7\,\left (a+b\right )\,\sqrt {-b^2\,\left (a+b\right )}\,\sqrt {-b^3-a\,b^2}}\right )}{4\,a}\right )}{\sqrt {-b^3-a\,b^2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________